import axios from '@/utils/http.js'

// 获取角色列表
export const getRoleListAPI = () => axios.get('/admin/role')

// 获取权限列表
export const getPermListAPI = () => axios.get('/admin/permissions')

// 获取角色对应的权限
export const getRolePermAPI = (id) => axios.get('/admin/role_perm', { params: { id } })

// 添加角色
export const addRoleAPI = (data) => axios.post('/admin/role', data)

// 删除角色
export const deleteRoleAPI = (id) => axios.delete('/admin/role', { data: { id } })

// 编辑角色
export const updateRoleAPI = (data) => axios.patch('/admin/role', data)
